<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		var a="小明";
		var b="快乐";
		var d="难过";
		
		var e=1;
		//while关键字必须要写
		while (e<=3){
			//e变量值的变化
			document.write("e变量的值为："+e+"<br />")
			//需要反复执行的代码
			var c=Math.floor(Math.random()*3+1);
			if(c==1){
				document.write(a);
			}else if(c==2){
				document.write(b);
			}else if(c==3){
				document.write(d);
			}
			e++;
			document.write("e变量经过e++后,e的值为："+e);
		}
	</script>
</html>